package com.zeus.hello;

import com.zeus.util.ActivitiUtil;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.repository.Deployment;
import org.junit.Test;

import java.io.InputStream;

/**
 * Created by Administrator on 2015/8/31.
 * 互斥网关
 * exclusivegateway
 */
public class ExclusiveProcess {
    ProcessEngine processEngine = ActivitiUtil.getProcessEngine();

    @Test
    public void deploymentProcessDefinitionByInputStream(){
        InputStream bpmnIn = this.getClass().getResourceAsStream("/diagrams/exclusiveProcess.bpmn");
        InputStream pngIn  = this.getClass().getResourceAsStream("/diagrams/exclusiveProcess.png");
        Deployment deployment = processEngine.getRepositoryService()
                .createDeployment()
                .name("分支流程")
                .addInputStream("exclusiveProcess.bpmn", bpmnIn)
                .addInputStream("exclusiveProcess.png", pngIn)
                .deploy();
        System.out.println("deploy ID:"+deployment.getId());
        System.out.println("deploy name:" + deployment.getName());
    }
}
